<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: blog_categories_edit.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geändert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

echo draw_form('categorie', FILENAME_BLOG, 'action=save_category', 'POST');

$language = get_languages();
$count_languages = sizeof($language);
?>
<table border="0" cellspacing="0" cellpadding="4">
<?php
    for($i = 0; $i < $count_languages; $i ++){

      $edit_categorie = $db->db_query("SELECT
      											categories_id, titel, status, position,meta_title,meta_desc,meta_key
          									FROM
          										".TABLE_BLOG_CATEGORIES."
          									WHERE
          										categories_id = '".(int)$_GET['cat']."'
          									AND
          										language_id = '".$languages[$i]['id']."'");

?>
  <tr>
    <td><?php echo TABLE_HEADING_NEWCATEGORIE_NAME;?></td>
    <td><img src="../lang/<?php echo $languages[$i]['directory'] ?>/<?php echo $languages[$i]['image']; ?>" alt="" /> <?php echo draw_input_field('titel['.$languages[$i]['id'].']', $edit_categorie->fields['titel'],'size="55"');?></td>
    <td><?php echo TABLE_HEADING_NEWCATEGORIE_POSITION;?></td>
    <td><?php echo draw_input_field('position['.$languages[$i]['id'].']', $edit_categorie->fields['position'],'size="4"');?></td>
  </tr>
  <tr>
  	<td><?php echo TABLE_HEADING_META_TITLE;?></td>
  	<td><img src="../lang/<?php echo $languages[$i]['directory'] ?>/<?php echo $languages[$i]['image']; ?>" alt="" /> <?php echo draw_input_field('meta_title['.$languages[$i]['id'].']', $edit_categorie->fields['meta_title'],'size="55"');?></td>
  	<td>&nbsp;</td><td>&nbsp;</td>
  </tr>
  <tr>
  	<td><?php echo TABLE_HEADING_META_DESCRIPTION ;?></td>
  	<td><img src="../lang/<?php echo $languages[$i]['directory'] ?>/<?php echo $languages[$i]['image']; ?>" alt="" /> <?php echo draw_input_field('meta_desc['.$languages[$i]['id'].']', $edit_categorie->fields['meta_desc'],'size="55"');?></td>
  	<td>&nbsp;</td><td>&nbsp;</td>
  </tr>
  <tr>
  	<td><?php echo TABLE_HEADING_META_KEYWORDS;?></td>
  	<td><img src="../lang/<?php echo $languages[$i]['directory'] ?>/<?php echo $languages[$i]['image']; ?>" alt="" /> <?php echo draw_input_field('meta_key['.$languages[$i]['id'].']', $edit_categorie->fields['meta_key'],'size="55"');?></td>
  	<td>&nbsp;</td><td>&nbsp;</td>
  </tr>
  <tr><td colspan="4"><hr /></td></tr>
<?php  } ?>
  <tr>
    <td colspan="4" align="right">
    	<?php

    	if(isset($_GET['cat'])) {
    		echo draw_hidden_field('action', 'update');
    		echo draw_hidden_field('categorie_id', (int)$_GET['cat']);
    	} else
    		echo draw_hidden_field('action', 'insert');
    	?>
    	<button type="submit" class="button" onclick="this.blur();"><?php echo BUTTON_SAVE?></button>
    </td>
  </tr>
</table>
</form>